# 有一个列表lst = [1,4,9,16,2,5,10,15]，生成一个新列表，要求新列表元素是lst相邻2项的和
lst = [1,4,9,16,2,5,10,15]

#循环原列表
new_lst1 = [lst[i]+lst[i+1] for i in range(len(lst) - 1)]
print(new_lst1)

#错位相加 去掉头尾
lst_0 = [0] + lst
lst_1 = lst + [0]
new_lst2 = [lst_0[i] + lst_1[i] for i in range(len(lst)+1)][1:-1]
print(new_lst2)


# 做得不错
